﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HZ.MBSM.DBUtility;

public partial class Manage_WithinInfo : System.Web.UI.Page
{
    public string strTitle, strContent, strAddDate;
    private string WithinInfoID;
    protected void Page_Load(object sender, EventArgs e)
    {
        System.Collections.Generic.List<HZ.MBSM.DAL.AccountType> _AccountType = new System.Collections.Generic.List<HZ.MBSM.DAL.AccountType>();
        _AccountType.Add(HZ.MBSM.DAL.AccountType.enumSupervise);
        _AccountType.Add(HZ.MBSM.DAL.AccountType.enumHospitale);
        if (HZ.MBSM.BLL.Login.CheckAssert(_AccountType))
        {
            WithinInfoID = SysFun.IsSQL(SysFun.ToTrim(Request.QueryString["WithinInfoID"]));
            if (!IsPostBack)
            {
                if (WithinInfoID != "" && WithinInfoID != null)
                {
                    string sql = "select WithinInfoId,Title,AddDate,Content,DOWNLOAD from WithinInfo ";
                    sql += "where WithinInfoID=" + WithinInfoID;
                    Db db = new Db();
                    try
                    {
                        System.Data.IDataReader dr;
                        dr = db.DataReader(sql);
                        if (dr.Read())
                        {
                            strTitle = dr["Title"].ToString();
                            strContent = dr["Content"].ToString().Replace("\r\n", "<br>");
                            strAddDate = Convert.ToDateTime(dr["AddDate"].ToString()).ToShortDateString();
                            string strDOWNURL = SysFun.ToTrim(dr["DOWNLOAD"].ToString());
                            if (strDOWNURL != "")
                            {
                                Label1.Text = "";
                                foreach (string strId in strDOWNURL.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries))

                                    Label1.Text += "&nbsp;&nbsp;<a class=9tw href='../UploadFile/" + strId + "' style='cursor:hand;' ><font size='2'>" + strId.Substring(0, strId.IndexOf(".")) + "</font></a>&nbsp;&nbsp;&nbsp;&nbsp;<br>";
                            }
                            else
                            {
                                Label1.Visible = false;
                            }

                        }
                        dr.Close();
                        dr.Dispose();

                        db.Close();
                    }
                    catch
                    {
                        db.Close();
                    }

                }


            }

        }
    }

}
